﻿@model Charades.Web.Models.ApplicationUser
@{
	Layout = "~/Views/Shared/_IndexLayout.cshtml";
	ViewBag.Title = "Рисуем и угадываем, Крокодил онлайн в браузере";
	var debug = ServerSettings.RootUrl.Host != "drawpi.co";
	var userData = User.Identity.IsAuthenticated && Model != null ?
					"userData: { name: '" + Model.DisplayName + "', color: '" + Model.Color + "' },"
					: string.Empty;
}
@section scripts{
	<script type="text/javascript">
		$(function () {
			App.init({
				name: 'drawpi.co',
				baseUrl: 'Scripts/app/', @(debug ? "debug: true," : string.Empty)
				require: ['ui'],
				homePage: '@(User.Identity.IsAuthenticated ? "profile" : "logon")', @Html.Raw(userData)
				ready: function () {
					$('#main-loader').hide();

					var items = $('.top-panel ul li'), delay = 0;
					TweenMax.set(items, { y: -50 });
					$('.top-panel').show();
					for (var i = items.length - 1; i >= 0; i--) {
						TweenMax.to(items[i], 1, { y: 0, delay: delay += 0.1, ease: Elastic.easeOut });
					}

					if (!App.isSupported()) {
						$.UIkit.notify({
							message: '<i class="uk-icon-warning"></i> {message}'.replace('{message}', Localization.BrowserProblem),
							status: 'warning',
							timeout: 5000,
							pos: 'top-center'
						});
					}
				}
			});
		});
	</script>
}
